package com.pug.security.controller;

import com.pug.security.service.security.LoginUser;
import org.springframework.security.core.Authentication;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class SecurityController {

    @PostMapping("/getinfo")
    public LoginUser getUserInfo(Authentication authentication) {
        return (LoginUser)authentication.getPrincipal();
    }

}
